<include file="Public:header" />
<div class="page-member subpage">
    <div class="form-header">
        <div>
            <div class="line1">
                <div class="fl"><h3>保障退出申请 / {$quit.house_no}</h3></div>
                <div class="fr hidden">
                    <form class="search-form" method="post" action="">
                        <input name="field" value="{$context.field}" type="hidden" />
                        <input name="value" value="{$context.value}" type="hidden" />
                        <input name="page" value="{$context.page}" type="hidden" />
                        <input name="order_field" value="{$context.order_field}" type="hidden" />
                        <input name="order_sort" value="{$context.order_sort}" type="hidden" />
                        <input name="offset" value="{$context.offset}" type="hidden" />
                        <input name="id" value="{$context.id}" type="hidden" />
                    </form>
                </div>
            </div>
            <div class="line2">
                <!-- 编辑按钮组 -->
                <if condition="$quit.state eq '待物业审核'">
                    <div class="fl form-btn-group btn-group-edit">
                        <in name="$x|default='02-03-13'" value="$rightsCode">
                            <button onclick="showDialog('dialog-wuye');" class="btn-save btn-highlight">物业审核</button>
                            <else />
                            <button disabled="disabled" class="btn-save btn-disable">物业审核</button>
                        </in>
                        <span>或</span>
                        <a onclick="action_edit();" class="linkBtn btn-abort" href="javascript:void(0);">编辑</a>
                    </div>
                </if>
                <if condition="$quit.state eq '待房产局审核'">
                    <div class="fl form-btn-group btn-group-edit">
                        <in name="$x|default='02-03-14'" value="$rightsCode">
                            <button onclick="showDialog('dialog-quit');" class="btn-save btn-highlight">房产局审核</button>
                            <else />
                            <button disabled="disabled" class="btn-save btn-disable">房产局审核</button>
                        </in>
                        <span>或</span>
                        <a onclick="action_edit();" class="linkBtn btn-abort" href="javascript:void(0);">编辑</a>
                    </div>
                </if>
                <!-- 保存按钮组 -->
                <div class="fl form-btn-group btn-group-save hidden">
                    <button onclick="action_save();" class="btn-save btn-highlight">保 存</button>
                    <span>或</span>
                    <a class="linkBtn btn-abort" onclick="action_abort();" href="javascript:void(0);">放弃</a>
                </div>
                <div class="fl form-btn-more">
                    <button class="btn-normal btn-more">
                        更多操作<i class="drop-down"></i>
                    </button>
                    <ul class="more-action hidden">
                        <in name="$x|default='02-03-12'" value="$rightsCode">
                            <li><a onclick="action_del2();" href="javascript:void(0);">删 除</a></li>
                        </in>
                        <eq name="u.username" value="admin">
                            <li><a onclick="showDialog('dialog-update');" href="javascript:void(0);">修正日期</a></li>
                        </eq>
                    </ul>
                </div>
                <div class="fr form-search-count">
                    <span class="index">{$context.index}/{$page.total}</span>
                    <button onclick="ItemJump({$page.prev.id}, {$page.prev.offset});" class="btn-normal">上一条</button>
                    <button onclick="ItemJump({$page.next.id}, {$page.next.offset});" class="btn-normal">下一条</button>
                </div>
            </div>
        </div>
    </div>
    <div class="form-box2">
        <div>
            <form id="quitForm" method="post" action="">
                <!--表单相关原始信息存储-->
                <input type="hidden" name="old_remarks" value="{$quit.remarks}" />
                <input type="hidden" name="old_remarks2" value="{$quit.remarks2}" />
                <table class="form">
                    <tr>
                        <th width="15%">房源地址<span class="hint">*</span></th>
                        <td width="35%" field="house_addr">{$quit.house_addr}</td>
                        <th width="15%">联系电话<span class="hint">*</span></th>
                        <td field="phone">{$quit.phone}</td>
                    </tr>
                    <tr>
                        <th>姓名<span class="hint">*</span></th>
                        <td field="name">{$quit.name}</td>
                        <th>身份证<span class="hint">*</span></th>
                        <td field="idno">{$quit.idno}</td>
                    </tr>
                    <tr>
                        <th>申请编号</th>
                        <td field="no">{$quit.yw_no}</td>
                        <th>合同编号</th>
                        <td field="contact_no">{$quit.contact_no}</td>
                    </tr>
                    <tr>
                        <th>退出原因<span class="hint">*</span></th>
                        <td field="reason">{$quit.reason}</td>
                        <th>审批状态<span class="hint">*</span></th>
                        <td field="state">{$quit.state}</td>
                    </tr>
                    <tr>
                        <td></td><td></td><td></td><td></td>
                    </tr>
                    <tr>
                        <th>物业审核意见<span class="hint">*</span></th>
                        <td field="opinion">{$quit.opinion}</td>
                        <th>物业审核日期<span class="hint">*</span></th>
                        <td field="wy_date">{$quit.wy_date}</td>
                    </tr>
                    <tr>
                        <th>物业审核人</th>
                        <td field="wy_user">{$quit.wy_user}</td>
                        <th>物业备注</th>
                        <td field="remarks">{$quit.remarks}</td>
                    </tr>
                    <tr>
                        <td></td><td></td><td></td><td></td>
                    </tr>
                    <tr>
                        <th>房产局审核意见<span class="hint">*</span></th>
                        <td field="opinion2">{$quit.opinion2}</td>
                        <th>房产局审核日期<span class="hint">*</span></th>
                        <td field="wy_date2">{$quit.wy_date2}</td>

                    </tr>
                    <tr>
                        <th>房产局审核人</th>
                        <td field="wy_user2">{$quit.wy_user2}</td>
                        <th>房产局备注</th>
                        <td field="remarks2">{$quit.remarks2}</td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
<include file="Public:quit_dialog" />
<include file="Public:wuye_dialog" />
<div class="dialog dialog-update hidden">
    <div class="box" style="height: 300px;">
        <div class="title">
            <h4 class="fl">修正日期对话框</h4>
            <span class="fr"><a href="#" onclick="closeDialog();">关闭</a></span>
        </div>
        <table class="form-tab">
            <tr>
                <th>住户申请日期：</th>
                <td><input type="text" name="ctime" value="{$quit.ctime|default=date('Y/m/d')}" /></td>
            </tr>
            <tr>
                <th>物业审批日期：</th>
                <td><input type="text" name="wy_date" value="{$quit.wy_date|default=date('Y/m/d')}" /></td>
            </tr>
            <tr>
                <th>房产局审批日期：</th>
                <td><input type="text" name="wy_date2" value="{$quit.wy_date2|default=date('Y/m/d')}" /></td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center;line-height:40px;">
                    <button class="btn btn-highlight" onclick="action_updateDateSubmit();">提交</button>
                    <span>或</span>
                    <a href="#" onclick="closeDialog();" class="linkBtn">放弃</a>
                </td>
            </tr>
        </table>
    </div>
</div>
<script>
    function action_updateDateSubmit() {
        var id = $("input[name=id]").val();
        var ctime = $("input[name=ctime]").val();
        var wy_date = $("input[name=wy_date]").val();
        var wy_date2 = $("input[name=wy_date2]").val();
        $.ajax({
            url:"/admin/quit/ajax_updateDate",
            data: {id:id, ctime:ctime, wy_date:wy_date,wy_date2:wy_date2}, type:"POST", dataType:"JSON",
            success: function(data){
                if(data.status){
                    alert("操作成功");
                    location.reload();
                }else{
                    console.log(data.info);
                    alert(data.info);
                }
            }
        });
    }
</script>
<script src="__JS__/quit.js" type="text/javascript" ></script>
<include file="Public:footer" />
